package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.WeekResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RechargeOrderMapper;
import com.ruoyi.system.domain.RechargeOrder;
import com.ruoyi.system.service.IRechargeOrderService;

/**
 * 充值订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-28
 */
@Service
public class RechargeOrderServiceImpl implements IRechargeOrderService 
{
    @Autowired
    private RechargeOrderMapper rechargeOrderMapper;

    /**
     * 查询充值订单
     * 
     * @param roId 充值订单主键
     * @return 充值订单
     */
    @Override
    public RechargeOrder selectRechargeOrderByRoId(Integer roId)
    {
        return rechargeOrderMapper.selectRechargeOrderByRoId(roId);
    }

    /**
     * 查询充值订单列表
     * 
     * @param rechargeOrder 充值订单
     * @return 充值订单
     */
    @Override
    public List<RechargeOrder> selectRechargeOrderList(RechargeOrder rechargeOrder)
    {
        return rechargeOrderMapper.selectRechargeOrderList(rechargeOrder);
    }

    /**
     * 新增充值订单
     * 
     * @param rechargeOrder 充值订单
     * @return 结果
     */
    @Override
    public int insertRechargeOrder(RechargeOrder rechargeOrder)
    {
        return rechargeOrderMapper.insertRechargeOrder(rechargeOrder);
    }

    /**
     * 修改充值订单
     * 
     * @param rechargeOrder 充值订单
     * @return 结果
     */
    @Override
    public int updateRechargeOrder(RechargeOrder rechargeOrder)
    {
        return rechargeOrderMapper.updateRechargeOrder(rechargeOrder);
    }

    /**
     * 批量删除充值订单
     * 
     * @param roIds 需要删除的充值订单主键
     * @return 结果
     */
    @Override
    public int deleteRechargeOrderByRoIds(Integer[] roIds)
    {
        return rechargeOrderMapper.deleteRechargeOrderByRoIds(roIds);
    }

    /**
     * 删除充值订单信息
     * 
     * @param roId 充值订单主键
     * @return 结果
     */
    @Override
    public int deleteRechargeOrderByRoId(Integer roId)
    {
        return rechargeOrderMapper.deleteRechargeOrderByRoId(roId);
    }

    /**
     * 获取本周每日充值金额
     */
    @Override
    public List<WeekResult> selectWeekRechargeAmount(){
        return rechargeOrderMapper.selectWeekRechargeAmount();
    };

    /**
     * 获取上周每日充值金额
     */
    @Override
    public List<WeekResult> selectLastWeekRechargeAmount(){
        return rechargeOrderMapper.selectLastWeekRechargeAmount();
    };

    /**
     * 获取今日充值金额
     */
    @Override
    public Double selectTodayRechargeAmount(){
        return rechargeOrderMapper.selectTodayRechargeAmount();
    };

    /**
     * 获取昨天充值金额
     */
    @Override
    public Double selectYesterdayRechargeAmount(){
        return rechargeOrderMapper.selectYesterdayRechargeAmount();
    };
}
